package com.church.action;



import com.church.base.common.util.ExtData;
import com.church.db.Tasklist;
import com.church.services.TasklistServices;


public class GetTaskList extends ChurchActionSupport {
	private TasklistServices tasklistServices;
	private ExtData<Tasklist> tasklist;
	public TasklistServices getTasklistServices() {
		return tasklistServices;
	}

	public void setTasklistServices(TasklistServices tasklistServices) {
		this.tasklistServices = tasklistServices;
	}

	public ExtData<Tasklist> getTasklist() {
		return tasklist;
	}

	public void setTasklist(ExtData<Tasklist> tasklist) {
		this.tasklist = tasklist;
	}

//	public String execute() {
//
////		tasklist = tasklistServices.getTasklist();
////		tasklist = tasklistServices.getTasklistByGroup(userGroup);
//		return "success";
//	}
	public String getAllTask()
	{
		tasklist = new ExtData<Tasklist>();
		tasklist.setRoot(tasklistServices.getTasklist());
		tasklist.setSuccess(true);
		this.setResData(tasklist);
		return SUCCESS;
	}
	public String getTaskByGroup()
	{
		try {
			String group = this.getUserInfo().getOrgName();
			tasklist = new ExtData<Tasklist>();
			tasklist.setRoot(tasklistServices.getTasklistByGroup(group));
			tasklist.setSuccess(true);
			this.setResData(tasklist);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}
}
